package com.simtop.service.impl;


import com.simtop.dao.SjDao;
import com.simtop.pojo.userpo.User;
import com.simtop.pojo.userpo.UserExamVo;
import com.simtop.service.SjServer;
import com.simtop.vo.exam.ExamVo;
import com.simtop.vo.exam.ExamVos;
import com.simtop.vo.sj.*;
import com.simtop.vo.word.WordExamSjVo;
import com.simtop.vo.word.WordExamVo;
import jnr.ffi.annotations.In;
import jnr.posix.WString;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

@Service
public class SjServerImpl implements SjServer {

    @Autowired
    private SjDao sjDao;

    @Override
    public List<sjVo> getAllSj(String op, String px, Integer dodId, Integer tableId, Integer sjtypeId,String search , Integer lasttypeId) {
        return sjDao.getAllSj(op,px,dodId,tableId,sjtypeId,search,lasttypeId);
    }

    @Override
    public List<sjVoSt> getAllSj2(Integer userId) {
        return sjDao.getAllSj2(userId);
    }

    @Override
    public List<sjVoSt> getAllSj3(String op, String px, Integer dodId, Integer tableId, Integer sjtypeId,String search,Integer userId) {
        return sjDao.getAllSj3(op,px,dodId,tableId,sjtypeId,search,userId);
    }

    @Override
    public List<sjVo> getAllSj4(String op, String px, Integer dodId, Integer tableId, Integer sjtypeId,String search,Integer userId) {
        return sjDao.getAllSj4(op,px,dodId,tableId,sjtypeId,search,userId);
    }

    @Override
    public List<sjVo> getAllSj5(String op, String px, Integer dodId, Integer tableId, Integer sjtypeId,String search,Integer userId) {
        return sjDao.getAllSj5(op,px,dodId,tableId,sjtypeId,search,userId);
    }

    @Override
    public List<ResourceFj> getListSjScource(Integer id) {
        return sjDao.getListSjScource(id);
    }

    @Override
    public boolean insertSj(InsertJsVo insertJsVo) {
        return sjDao.insertSj(insertJsVo);
    }

    @Override
    public List<SjTypeVo> getSjType() {
        return sjDao.getType();
    }

    @Override
    public void insertSjcources(String upload, Integer sjid, String namesj, String typesj) {
        sjDao.insertSjcources(upload,sjid,namesj,typesj);
    }

    @Override
    public void insertPng(String upload, String namesj, String typesj , Integer sjId) {
        sjDao.insertPng(upload,namesj,typesj,sjId);
    }

    @Override
    public int updateSj(InsertJsVo insertJsVo) {
        return sjDao.updateSj(insertJsVo);
    }

    @Override
    public int deleteSj(Integer id) {
        return sjDao.deleteSj(id);
    }

    @Override
    public boolean insertExam(ExamVo examVo) {
        return sjDao.insertExam(examVo);
    }

    @Override
    public void insertExamSj(Integer examId, Integer sjIds) {
        sjDao.insertExamSj(examId , sjIds);
    }

    @Override
    public List<ExamVos> findExam(String op , String px , String examName) {
        return sjDao.findExam(op , px , examName);
    }

    @Override
    public List<ExamVos> findExamUser(String op, String px, String examName) {
        return sjDao.findExamUser(op , px ,examName);
    }

    @Override
    public ExamVos findExam2(Integer examId) {
        return sjDao.findExam2(examId);
    }

    @Override
    public List<sjVo> findExamSj(Integer examId, String op, String px) {
        return sjDao.findExamSj(examId , op , px);
    }

    @Override
    public int findCount(Integer id) {
        return sjDao.findCount(id);
    }

    @Override
    public void deleteExamByid(Integer examId) {
        sjDao.deleteExamByid(examId);
    }

    @Override
    public int deleteExam(Integer examId) {
        return sjDao.deleteExam(examId);
    }

    @Override
    public List<sjVo> findStuExamSj(Integer examId) {
        return sjDao.findStuExamSj(examId);
    }

    @Override
    public List<sjVos> findStuSJ(Integer examId) {
        return sjDao.findStuSJ(examId);
    }

    @Override
    public List<sjVos> findStuSJ2(Integer examId) {
        return sjDao.findStuSJ2(examId);
    }

    @Override
    public sjVoss findone(Integer examId, Integer stuexamId, Integer sjId) {
        return sjDao.findone(examId  , stuexamId , sjId);
    }

    @Override
    public String selectExName(Integer examId) {
        return sjDao.selectExName(examId);
    }

    @Override
    public void createStuSj(Integer id, Object sjIds) {
        sjDao.createStuSj(id, sjIds);
    }

    @Override
    public void createStuSj2(Integer id, Object sjIds) {
        sjDao.createStuSj2(id, sjIds);
    }

    @Override
    public void insertStuSj(Integer sjId, Integer userId, String answer) {
        sjDao.insertStuSj(sjId,userId,answer);
    }

    @Override
    public void deleteSjStuXl(Integer sjId, Integer userId) {
        sjDao.deleteSjStuXl(sjId , userId);
    }

    @Override
    public List<Map<Object, Object>> stuCountXlOrigin(Integer userId) {
        return sjDao.stuCountXlOrigin(userId);
    }

    @Override
    public List<Map<Object, Object>> stuCountXlDod(Integer userId) {
        return sjDao.stuCountXlDod(userId);
    }

    @Override
    public List<Map<Object, Object>> stuCountXlType(Integer userId) {
        return sjDao.stuCountXlType(userId);
    }

    @Override
    public List<Map<Object, Object>> stuCountXlTable(Integer userId) {
        return sjDao.stuCountXlTable(userId);
    }


    @Override
    public List<Map<Object, Object>> stuCountXlCom(Integer userId) {
        return sjDao.stuCountXlCom(userId);
    }

    @Override
    public void deleteStu(Integer id) {
        sjDao.deleteStu(id);
    }

    @Override
    public Date findCreateTime(Integer stuexamId) {
        return sjDao.findCreateTime(stuexamId);
    }

    @Override
    public int findisover(Integer id) {
        return sjDao.findisover(id);
    }

    @Override
    public int findallover() {
        return sjDao.findallover();
    }

    @Override
    public void updateExames(Integer examId, Integer examTime, Integer assessMent, String examName) {
        sjDao.updateExames(examId, examTime , assessMent , examName);
    }

    @Override
    public List<LastTypeVo> getlasttype(Integer id) {
        return sjDao.getlasttype(id);
    }

    @Override
    public ExamVos findOneExam(Integer examId) {
        return sjDao.findOneExam(examId);
    }

    @Override
    public List<WordExamVo> findwordExamVos(Integer examId) {
        return sjDao.findwordExamVos(examId);
    }

    @Override
    public List<WordExamSjVo> findWordExamSj(Integer examId, Integer tableId) {
        return sjDao.findWordExamSj(examId, tableId);
    }

    @Override
    public List<UserExamVo> getExamNameUser(Integer examId) {
        return sjDao.getExamNameUser(examId);
    }

    @Override
    public void DeleteExamUser(Integer examId) {
        sjDao.DeleteExamUser(examId);
    }

    @Override
    public int updateForPdf(Integer userid, Integer stuexamid, String as) {
        return sjDao.updateForPdf(userid , stuexamid , as);
    }

    @Override
    public List<String> findListAllStu(Integer examid) {
        return sjDao.findListAllStu(examid);
    }

    @Override
    public String findListAllStuForEx(Integer id) {
        return sjDao.findListAllStuForEx(id);
    }

    @Override
    public Date selectoutos(Integer stuexamId) {
        return sjDao.selectoutos(stuexamId);
    }
}
